<?php

class SM_Controller extends MX_Controller
{

    private $_head = array();

    function __construct()
    {
        parent::__construct();
    }

    public function getHead()
    {
        return $this->_head;
    }

    public function setHead($metadata)
    {
        $this->_head = $metadata;
    }

}

class SM_ADMIN_Controller extends SM_Controller
{

    function __construct()
    {
        parent::__construct();
        $head = array();
        $metadata = array();
        $metadata['title'] = $this->lang->line('ADMIN.SITE.TITLE');
        $metadata['description'] = $this->lang->line('ADMIN.SITE.DESCRIPTION');
        $metadata['author'] = $this->lang->line('ADMIN.SITE.AUTHOR');
        $head['metadata'] = $metadata;
        $this->setHead($head);
        $this->load->vars($this->getHead());
        if (!$this->session->userdata('loggedin')) {
            if ($this->router->fetch_method() != 'login') {
                redirect_admin('auth/login');
            }
        }
    }

}

class SM_BASE_Controller extends SM_Controller
{

    function __construct()
    {
        parent::__construct();
        header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
    }

}
